package com.zhangwei.utils;

//枚举定义常量
public enum StatusCode {

    SUCCESS(0,"成功"),  // attention symbol
    PARAM_ERROR(1, "参数不正确或不符合规范"),
    NOT_EXIST(2,"数据不存在或者无法查询"),
    ADD_FAILED(3,"新增数据失败"),
    DEL_FAILED(4,"删除数据失败"),
    QUERY_FAILED(5,"查询数据失败"),
    UPDATE_FAILED(6,"修改数据失败"),
    REDIS_ERR(10,"缓存出错");

    private final Integer code;  //状态码
    private final String description;  //描述

    StatusCode(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
